package com.ruoyi.mywork.repository.generator.mapper;

import com.ruoyi.mywork.repository.generator.entity.LocationInviteCode;
import com.ruoyi.mywork.repository.generator.entity.LocationInviteCodeExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface LocationInviteCodeMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table location_invite_code
     *
     * @mbg.generated Mon Apr 28 22:41:41 CST 2025
     */
    @SelectProvider(type=LocationInviteCodeSqlProvider.class, method="countByExample")
    long countByExample(LocationInviteCodeExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table location_invite_code
     *
     * @mbg.generated Mon Apr 28 22:41:41 CST 2025
     */
    @DeleteProvider(type=LocationInviteCodeSqlProvider.class, method="deleteByExample")
    int deleteByExample(LocationInviteCodeExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table location_invite_code
     *
     * @mbg.generated Mon Apr 28 22:41:41 CST 2025
     */
    @Delete({
        "delete from location_invite_code",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table location_invite_code
     *
     * @mbg.generated Mon Apr 28 22:41:41 CST 2025
     */
    @Insert({
        "insert into location_invite_code (code, team_id, ",
        "inviter_id, ctime)",
        "values (#{code,jdbcType=VARCHAR}, #{teamId,jdbcType=BIGINT}, ",
        "#{inviterId,jdbcType=BIGINT}, #{ctime,jdbcType=TIMESTAMP})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Long.class)
    int insert(LocationInviteCode row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table location_invite_code
     *
     * @mbg.generated Mon Apr 28 22:41:41 CST 2025
     */
    @InsertProvider(type=LocationInviteCodeSqlProvider.class, method="insertSelective")
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Long.class)
    int insertSelective(LocationInviteCode row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table location_invite_code
     *
     * @mbg.generated Mon Apr 28 22:41:41 CST 2025
     */
    @SelectProvider(type=LocationInviteCodeSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="code", property="code", jdbcType=JdbcType.VARCHAR),
        @Result(column="team_id", property="teamId", jdbcType=JdbcType.BIGINT),
        @Result(column="inviter_id", property="inviterId", jdbcType=JdbcType.BIGINT),
        @Result(column="ctime", property="ctime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<LocationInviteCode> selectByExample(LocationInviteCodeExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table location_invite_code
     *
     * @mbg.generated Mon Apr 28 22:41:41 CST 2025
     */
    @Select({
        "select",
        "id, code, team_id, inviter_id, ctime",
        "from location_invite_code",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="code", property="code", jdbcType=JdbcType.VARCHAR),
        @Result(column="team_id", property="teamId", jdbcType=JdbcType.BIGINT),
        @Result(column="inviter_id", property="inviterId", jdbcType=JdbcType.BIGINT),
        @Result(column="ctime", property="ctime", jdbcType=JdbcType.TIMESTAMP)
    })
    LocationInviteCode selectByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table location_invite_code
     *
     * @mbg.generated Mon Apr 28 22:41:41 CST 2025
     */
    @UpdateProvider(type=LocationInviteCodeSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("row") LocationInviteCode row, @Param("example") LocationInviteCodeExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table location_invite_code
     *
     * @mbg.generated Mon Apr 28 22:41:41 CST 2025
     */
    @UpdateProvider(type=LocationInviteCodeSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("row") LocationInviteCode row, @Param("example") LocationInviteCodeExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table location_invite_code
     *
     * @mbg.generated Mon Apr 28 22:41:41 CST 2025
     */
    @UpdateProvider(type=LocationInviteCodeSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(LocationInviteCode row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table location_invite_code
     *
     * @mbg.generated Mon Apr 28 22:41:41 CST 2025
     */
    @Update({
        "update location_invite_code",
        "set code = #{code,jdbcType=VARCHAR},",
          "team_id = #{teamId,jdbcType=BIGINT},",
          "inviter_id = #{inviterId,jdbcType=BIGINT},",
          "ctime = #{ctime,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(LocationInviteCode row);
}